platform :ios, '14.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'iosApp.xcodeproj', 'Debug' => :debug, 'Profile' => :release, 'Release' => :release

# 最小化依赖配置
def ios_pods
  # 暂时不添加外部依赖，以确保基本构建成功
  # GoogleMLKit需要CocoaPods 1.12.0+，当前版本是1.10.2
end

# 主应用目标
target 'iosApp' do
  use_frameworks!  # 使用框架而不是静态库
  ios_pods
end

# 禁用生成的测试目标的构建
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # 禁用bitcode（一些库不支持）
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      
      # 添加Swift支持
      config.build_settings['SWIFT_VERSION'] = '5.0'
      
      # 确保支持arm64架构
      config.build_settings['ARCHS'] = ['arm64', 'x86_64']
    end
  end
end